//
//  BaseViewController.swift
//  AnJiBei
//
//  Created by 赵鑫 on 15/10/31.
//  Copyright © 2015年 赵鑫. All rights reserved.
//

import UIKit

import Foundation

class BaseViewController: UIViewController , RequestDelegate {

    var selfController: BaseViewController?
    
    /// 一个页面多个请求的判断值
    var requestType:Int = 0
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
//    
//    /**
//     获取model list
//     
//     :param: data 传回来的json 数据
//     :param: obj  以及需要转换的model
//     
//     :returns: 返回list
//     */
//    func getModelList(data:AnyObject?)->Array<AnyObject>{
//        //return D3Json.jsonToModelList(data, objc: obj!)
//        return D3Json.jsonToModelList(data)
//    }
//    /**
//     获取model
//     
//     :param: data 传回来的json 数据
//     :param: obj  以及需要转换的model
//     
//     :returns: 返回model
//     */
//    
//    func getModel<T>(obj:AnyObject?)->T{
//       // return D3Json.jsonToModel(data, objc: obj)
//        return D3Json.jsonToModel(obj)
//    }
    
    
    /**
     开始请求
     
     :param: url  请求链接
     :param: parm 请求参数
     */
    func startRequest(url:String,parm:Reflect){
        RequestUtils.requestJson(url, parameter: D3Json.objectConvertJson(parm), requestDelegate: self)
        
    }
    
    /**
     消息提示框
     
     - parameter message: 提示的消息
     */
    func disPlayMessage(message: String) {
        
        let alterView = UIAlertView(title: "提示", message: message, delegate: self, cancelButtonTitle: "确定")
        alterView.show()
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
